package com.py.framework.scheduler.job.detail;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import com.py.framework.core.log.DebugLogger;
import com.py.framework.scheduler.common.RequestJobHelper;
import com.py.framework.scheduler.job.Job;

/**
 * 任务明细
 * @author Leegern
 * @date   2018年5月7日
 */
@Service
public class DefaultJobDetail implements JobDetail {
	
	
	/*
	 * (non-Javadoc)
	 * @see com.py.framework.scheduler.job.detail.JobDetail#doJob(com.py.framework.scheduler.job.Job)
	 */
	@Override
	public void doJob(Job job) {
		if (null != job && StringUtils.isNotBlank(job.getRequestUrl())) {
			DebugLogger.debug("request remote task url[" + job.getRequestUrl() + "]");
			// 发送异步任务调度请求
			RequestJobHelper.postAsyncJob(job.getRequestUrl());
		}
	}
}